#include <stdio.h>
#include<sys/types.h>
#include<unistd.h>

int main()
{
  pid_t ret=fork();
  if(ret<0){
    perror("fork is fail\n");
    return 1;
  }
  else if(ret==0){
    //子进程 ret=0
    printf("子进程：%d ,father :%d,&ret:%p\n",getpid(),getppid(),&ret);
    sleep(1);
  }
  else{
		//父进程 ret>0
    printf("父进程：%d ,father :%d,&ret:%p\n",getpid(),getppid(),&ret);
  }
	return 0;
}
